import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String str1 = sc.nextLine();
        String str2 = sc.nextLine();
        Set<Character> set = new HashSet<>();
        for(char ch:str2.toCharArray()){
            set.add(ch);
        }
        StringBuffer sb = new StringBuffer();
        for(int i = 0; i < str1.length(); i++){
            if(!set.contains(str1.charAt(i))){
                sb.append(str1.charAt(i));
            }
        }
        System.out.print(sb.toString());
    }
}
